:root {
  --color-primary: #3b82f6;
  --color-secondary: #059669;
  --color-title: #1e293b;
  --color-subtitle: #334155;
  --color-text: #475569;
  --color-light-text: #64748b;
  --color-extra-light-text: #94a3b8;
  --color-border: #e5e7eb;
  --color-background: #f1f5f9;
  --color-header-title: #2c3e50;
}

/* 整体布局 */
body {
  background: var(--color-background);
  margin: 0;
  padding: 20px;
}

.resume {
  width: 210mm;
  /* A4 纸宽度 */
  min-height: 297mm;
  /* A4 纸高度 */
  margin: 0 auto;
  padding: 15mm;
  /* 减小打印边距 */
  background: #ffffff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

/* 头部样式优化 */
.header {
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.header h1 {
  font-size: 24px;
  margin: 0 0 2px 0;
}

.position-title {
  font-size: 15px;
  margin-bottom: 6px;
}

.basic-info, .contact-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.basic-info {
  margin-bottom: 6px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-light-text);
  font-size: 14px;
  white-space: nowrap;
}

.info-icon {
  font-size: 14px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
}

/* 各部分通用样式优化 */
.section {
  margin-bottom: 8px;
}

.section:last-child {
  margin-bottom: 0;
}

.section.dragging {
  background: var(--color-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  position: relative;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
  cursor: move;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
}

.section-icon {
  font-size: 20px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 4px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  color: var(--color-title);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 打印样式优化 */
@media print {
  @page {
    size: A4;
    margin: 0;
    padding-top: 1cm;
    padding-bottom: 1cm;
  }

  @page :first {
    padding-top: 0;
  }

  html,
  body {
    margin: 0;
    padding: 0 !important;
  }

  .resume {
    /* width: 210mm;
    height: auto !important;
    min-height: initial !important;
    padding: 20mm !important;

    */
    margin: 0 !important;
    box-shadow: none !important;
    /* border-radius: 0 !important;
    background: white !important; */
    overflow: visible !important;
  }

  /*
  .theme-selector {
    display: none;
  }

  .section {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: none !important;
    box-shadow: none !important;
    margin-bottom: 15px !important;
  }

  .section-header::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .experience-item,
  .project-item,
  .education-item,
  .honor-item,
  .paper-item {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-button,
  .theme-selector,
  .drag-handle {
    display: none !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* 确保颜色正确打印 */
  .section-icon,
  .info-icon,
  .position-title,
  .paper-journal,
  .paper-index {
    color: var(--color-primary) !important;
  }

  .section-title,
  .header h1,
  .company-info h3,
  .project-info h3,
  .honor-name,
  .paper-title,
  .school-name {
    color: var(--color-title) !important;
  }

  */

  /* 调整页面之间的间距 */
  .section:first-child {
    margin-top: 0 !important;
  }

  .section:last-child {
    margin-bottom: 0 !important;
  }

  /* 确保背景色和边框正确打印 */
  .tech-tag,
  .skill-tag {
    background-color: var(--color-background) !important;
    border: 1px solid var(--color-border) !important;
  }

  .header {
    margin-bottom: 8px !important;
    padding-bottom: 4px !important;
  }

  .basic-info {
    margin-bottom: 4px !important;
  }

  .basic-info, .contact-info {
    gap: 12px !important;
  }
}

/* 工作经验样式优化 */
.experience-item {
  margin-bottom: 8px;
  padding-left: 8px;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.company-info h3 {
  color: var(--color-subtitle);
  font-size: 15px;
  margin: 0;
  font-weight: 600;
}

.job-title {
  color: #64748b;
  margin-top: 3px;
  font-size: 14px;
}

.experience-period {
  color: var(--color-extra-light-text);
  font-size: 14px;
}

.experience-achievements, .experience-responsibilities {
  color: var(--color-text);
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.experience-achievements li , .experience-responsibilities li{
  margin-bottom: 2px;
  line-height: 1.3;
}

.experience-achievements li:last-child , .experience-responsibilities li:last-child{
  margin-bottom: 0;
}

/* 工作经历下项目时间线样式 */
.experience-projects {
  margin-top: 10px;
  margin-bottom: 10px;
}

.projects-timeline-title {
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.projects-timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 2px;
  list-style: none;
  border-left: 2px solid var(--color-primary);
}

.project-timeline-item {
  position: relative;
  margin-bottom: 18px;
  padding-left: 16px;
}

.project-timeline-item:last-child {
  margin-bottom: 0;
}

.project-timeline-item::before {
  content: '';
  position: absolute;
  left: -9px;
  /* top: 8px; */
  width: 12px;
  height: 12px;
  background: #fff;
  border: 3px solid var(--color-primary);
  border-radius: 50%;
  z-index: 1;
  box-sizing: border-box;
}


/* 让竖线延伸到最后一个圆点 */
.projects-timeline::after {
  content: '';
  display: block;
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-primary);
  z-index: 0;
}

/* 项目内容右侧对齐美化 */
.project-timeline-item > .project-name {
  font-size: 14px;
  color: var(--color-title);
  font-weight: 600;
  margin-bottom: 2px;
}

/* 教育经历样式优化 */
.education-item {
  margin-bottom: 8px;
}

.education-item:last-child {
  margin-bottom: 0;
}

.education-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 6px 12px;
  font-size: 14px;
  border-bottom: 1px dashed #e5e7eb;
}

.education-item:last-child .education-row {
  border-bottom: none;
}

.school-name {
  font-weight: 600;
  color: #334155;
  min-width: 100px;
}

.degree-name {
  color: #475569;
  flex: 1;
}

.education-type {
  color: #64748b;
  min-width: 70px;
}

.education-period {
  color: #94a3b8;
  min-width: 140px;
  text-align: right;
}

/* 技能专长样式优化 */
.skills-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0 15px;
}

.skill-category {
  margin-bottom: 15px;
}

.skill-category h3 {
  color: #334155;
  font-size: 15px;
  margin-bottom: 10px;
  font-weight: 600;
}

.skill-tag {
  display: inline-block;
  padding: 4px 10px;
  margin: 3px;
  background: #f1f5f9;
  border-radius: 4px;
  color: #475569;
  font-size: 10px;
}

/* 项目经历样式优化 */
.project-item {
  /* margin-bottom: 12px; */
  padding: 8px 0;  /* 移除左右内边距 */
  border-bottom: 1px dashed var(--color-border);  /* 使用虚线分隔符 */
}

.project-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.project-header {
  margin-bottom: 4px;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.project-name-tech {
  flex: 1;
}

.project-name {
  color: var(--color-title);
  font-size: 14px;
  font-weight: 600;
  display: inline;
  margin-right: 8px;
}

.project-period {
  color: var(--color-extra-light-text);
  font-size: 14px;
  white-space: nowrap;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.tech-tag {
  padding: 2px 8px;
  background: var(--color-background);
  border-radius: 3px;
  color: var(--color-primary);
  font-size: 10px;
  border: 1px solid var(--color-primary);
}

/* 项目内容样式优化 */
.project-background,
.project-responsibilities,
.project-results {
  margin-bottom: 10px;
}

.project-background:last-child,
.project-responsibilities:last-child,
.project-results:last-child {
  margin-bottom: 0;
}

.project-background h4,
.project-responsibilities h4,
.project-results h4 {
  color: var(--color-subtitle);
  font-size: 14px;
  margin: 0 0 6px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.project-background h4::before,
.project-responsibilities h4::before,
.project-results h4::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background-color: var(--color-primary);
  border-radius: 50%;
  margin-right: 8px;
}

.project-background p,
.project-results p {
  margin: 0;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.6;
  padding-left: 12px;
}

.project-responsibilities ul {
  margin: 0;
  padding-left: 24px;
  list-style-type: none;
}

.project-responsibilities li {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.6;
  /* margin-bottom: 4px; */
  position: relative;
}

.project-responsibilities li:last-child {
  margin-bottom: 0;
}

.project-responsibilities li::before, .enhanced-list li::before {
  content: "•";
  color: var(--color-primary);
  position: absolute;
  left: -12px;
}

/* 技能专长样式优化 */
.skills-list {
  list-style: none;
  padding: 0 12px;
  margin: 0;
}

.skills-list li {
  position: relative;
  padding-left: 12px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.4;
}

.skills-list li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-primary);
}

.skills-list li:last-child {
  margin-bottom: 0;
}

/* 荣誉奖项样式优化 */
.honors-list {
  padding: 0;
}

.honor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.honor-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.honor-main {
  display: flex;
  gap: 12px;
  align-items: center;
}

.honor-name {
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}

.honor-issuer {
  color: #64748b;
  font-size: 14px;
}

.honor-date {
  color: #94a3b8;
  font-size: 14px;
}

/* PDF 导出按钮样式 */
.print-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 1000;
}

.print-button:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 科研论文样式优化 */
.papers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.paper-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.paper-item:last-child {
  border-bottom: none;
}

.paper-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.paper-title {
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-authors {
  color: #475569;
  font-size: 14px;
  white-space: nowrap;
}

.paper-info {
  display: flex;
  gap: 15px;
  color: #64748b;
  font-size: 14px;
  white-space: nowrap;
}

.paper-journal {
  color: #3b82f6;
}

.paper-index {
  color: #059669;
  font-weight: 500;
}

/* 文件选择器样式 */
.file-selector {
  margin-right: 20px;
}

.file-select {
  padding: 8px 16px;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  background: white;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-select:hover {
  background: var(--color-background);
}

.file-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 主题选择器样式 */
.theme-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

.theme-button {
  padding: 8px 16px;
  border: 2px solid var(--theme-color);
  background: white;
  color: var(--theme-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.theme-button:hover {
  background: var(--theme-color);
  color: white;
}

.theme-button.active {
  background: var(--theme-color);
  color: white;
}

/* 拖拽相关样式 */
.drag-handle {
  display: flex;
  align-items: center;
  color: var(--color-light-text);
  cursor: move;
}

.drag-icon {
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.section-header:hover .drag-icon {
  opacity: 1;
}

/* @media print {
  .drag-handle {
    display: none;
  }

  .section {
    background: none;
    box-shadow: none;
  }
} */

/* 加载状态样式 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-size: 18px;
    color: var(--color-primary);
}

.blog-icons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.blog-icon-link {
  transition: transform 0.2s, color 0.2s;
  color: var(--color-light-text);
  font-size: 14px;
  display: flex;

}

.blog-icon-link:hover, .blog-icon-link:active{
  color: var(--color-primary); /* Use theme hover color */
}


/* 确保打印时的紧凑布局 */
@media print {
  .resume {
    padding: 12mm !important;
  }

  .section {
    margin-bottom: 6px !important;
  }

  .section-header {
    margin-bottom: 6px !important;
  }

  .experience-item,
  .project-item,
  .education-item,
  .honor-item,
  .paper-item {
    margin-bottom: 4px !important;
  }

  .experience-achievements li,
  .project-responsibilities li,
  .skills-list li {
    margin-bottom: 1px !important;
    line-height: 1.3 !important;
  }

  .project-overview {
    margin: 3px 0 !important;
  }

  /* .project-item {
    break-inside: avoid;
    border-left: 2px solid var(--color-primary) !important;
    padding: 6px 10px !important;
    margin-bottom: 8px !important;
  } */

  .project-background h4::before,
  .project-responsibilities h4::before,
  .project-results h4::before {
    background-color: var(--color-primary) !important;
  }
}

.enhanced-block {
  margin: 18px 0 10px 0;
  padding-left: 0;
}

.enhanced-title {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.08em;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.vertical-bar {
  display: inline-block;
  width: 5px;
  height: 1.2em;
  background: var(--color-primary, #2563eb);
  border-radius: 2px;
  margin-right: 10px;
}

.enhanced-list {
  margin: 0 0 0 18px;
  padding: 0;
  list-style: disc inside;
  font-size: 1em;
  line-height: 1.7;
  color: var(--color-text, #334155);
  list-style: none;
  position: relative;
}

.enhanced-list li::before {
  content: "•";
  color: var(--color-primary);
  position: absolute;
  left: -12px;
}

.enhanced-list li {
  line-height: 1.7;
}

.enhanced-block + .enhanced-block {
  margin-top: 8px;
}

@media (prefers-color-scheme: dark) {
  .enhanced-title {
    color: #e0e7ef;
  }
  .enhanced-list {
    color: #cbd5e1;
  }
  .vertical-bar {
    background: var(--color-primary, #60a5fa);
  }
}

@media print {
  .enhanced-title {
    color: #222 !important;
  }
  .vertical-bar {
    background: #222 !important;
  }
  .enhanced-list {
    color: #222 !important;
  }
}

.toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 16px;
}
.language-selector, .theme-selector, .file-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}
.language-button, .theme-button, .file-select {
  margin: 0 2px;
}

.language-button {
  padding: 8px 16px;
  border: 2px solid var(--color-primary, #2563eb);
  background: transparent;
  color: var(--color-primary, #2563eb);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.language-button:hover {
  background: var(--color-primary, #2563eb);
  color: white;
}

.language-button.active {
  background: var(--color-primary, #2563eb);
  color: white;
}